﻿//Copyright 2011 - Jonathan Allen

using System;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics.Contracts;

namespace Granite.ComponentModel
{
	/// <summary>
	/// This is used for ItemAdded and ItemRemoved events to indicate which item was affected.
	/// </summary>
	/// <typeparam name="T"></typeparam>
    [Pure]
    public class ItemEventArgs<T> : EventArgs
    {
        readonly T m_Item;

		/// <summary>
		/// Create a new instance of ItemEventArgs with the indicated item.
		/// </summary>
		/// <param name="item"></param>
        [Pure]
        public ItemEventArgs(T item)
        {
            m_Item = item;
        }

		/// <summary>
		/// Item that was added or removed
		/// </summary>
        public T Item
        {
            get { return m_Item; }
        }
    }
}